<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MaxGtop医院 - 科室管理</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css">
    <style>
        :root {
            --primary: #2563eb;
            --primary-dark: #1e40af;
            --secondary: #64748b;
            --success: #059669;
            --danger: #dc2626;
            --warning: #d97706;
            --info: #0284c7;
            --light: #f1f5f9;
            --dark: #0f172a;
            --white: #ffffff;
            --body-bg: #f8fafc;
            --border-color: #e2e8f0;
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: "Microsoft YaHei", system-ui, -apple-system, sans-serif;
            background: url(./images/111.jpg) center center;
            background-size: cover;
            color: var(--dark);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* 顶部导航栏 */
        .navbar {
            background: var(--white);
            box-shadow: var(--shadow);
            padding: 1rem 2rem;
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .navbar-brand {
            font-size: 1.75rem;
            font-weight: 600;
            color: var(--primary);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .navbar-brand i {
            font-size: 2rem;
        }

        .nav-link {
            color: var(--secondary);
            font-size: 1rem;
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            transition: all 0.3s ease;
        }

        .nav-link:hover,
        .nav-link.active {
            color: var(--primary);
            background: var(--light);
        }

        /* 主要内容区 */
        .main-container {
            flex: 1;
            padding: 2rem;
            max-width: 1800px;
            margin: 0 auto;
            width: 100%;
        }

        .content-grid {
            display: grid;
            grid-template-columns: 300px 1fr;
            gap: 2rem;
        }

        /* 侧边栏 */
        .sidebar {
            background: var(--white);
            border-radius: 1rem;
            box-shadow: var(--shadow);
            overflow: hidden;
        }

        .sidebar-header {
            padding: 1.5rem;
            background: var(--primary);
            color: var(--white);
        }

        .sidebar-header h2 {
            font-size: 1.25rem;
            margin: 0;
        }

        .nav-menu {
            padding: 1rem;
        }

        .nav-item {
            margin-bottom: 0.5rem;
        }

        .nav-menu .nav-link {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 1rem;
            color: var(--dark);
            text-decoration: none;
            border-radius: 0.5rem;
            transition: all 0.3s ease;
        }

        .nav-menu .nav-link:hover,
        .nav-menu .nav-link.active {
            background: var(--light);
            color: var(--primary);
        }

        .nav-menu .nav-link i {
            font-size: 1.25rem;
        }

        /* 主要内容 */
        .main-content {
            background: var(--white);
            border-radius: 1rem;
            box-shadow: var(--shadow);
            padding: 2rem;
        }

        .content-header {
            margin-bottom: 2rem;
        }

        .content-header h1 {
            font-size: 1.5rem;
            color: var(--dark);
            margin-bottom: 0.5rem;
        }

        /* 表单样式 */
        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-label {
            display: block;
            margin-bottom: 0.5rem;
            color: var(--secondary);
            font-weight: 500;
        }

        .form-control {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 1px solid var(--border-color);
            border-radius: 0.5rem;
            font-size: 1rem;
            transition: all 0.3s ease;
        }

        .form-control:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
            outline: none;
        }

        .form-select {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 1px solid var(--border-color);
            border-radius: 0.5rem;
            font-size: 1rem;
            transition: all 0.3s ease;
            background-color: var(--white);
        }

        .form-select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
            outline: none;
        }

        .btn-submit {
            padding: 0.75rem 2rem;
            border-radius: 0.5rem;
            font-size: 1rem;
            font-weight: 500;
            background: var(--primary);
            color: var(--white);
            border: none;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .btn-submit:hover {
            background: var(--primary-dark);
            transform: translateY(-1px);
        }

        @media (max-width: 1200px) {
            .content-grid {
                grid-template-columns: 250px 1fr;
            }
        }

        @media (max-width: 992px) {
            .content-grid {
                grid-template-columns: 1fr;
            }

            .main-container {
                padding: 1rem;
            }
        }

        @media (max-width: 768px) {
            .navbar {
                padding: 1rem;
            }

            .main-content {
                padding: 1.5rem;
            }
        }
    </style>
</head>
<body>
    <!-- 顶部导航栏 -->
    <nav class="navbar">
        <div class="container-fluid d-flex justify-content-between align-items-center">
            <div class="d-flex align-items-center">
                <a class="navbar-brand" href="#">
                    <i class="bi bi-heart-pulse-fill"></i>
                    MaxGtop医院
                </a>
                <span class="student-id">202321130042</span>
            </div>
            <div class="d-flex gap-3">
                <a href="./query" class="nav-link">
                    <i class="bi bi-house-heart"></i>
                    首页
                </a>
                <a href="login.jsp" class="nav-link">
                    <i class="bi bi-box-arrow-right"></i>
                    退出登录
                </a>
            </div>
        </div>
    </nav>

    <!-- 主要内容区 -->
    <div class="main-container">
        <div class="content-grid">
            <!-- 侧边栏 -->
            <aside class="sidebar">
                <div class="sidebar-header">
                    <h2><i class="bi bi-grid"></i> 功能导航</h2>
                </div>
                <nav class="nav-menu">
                    <div class="nav-item">
                        <a href="./query" class="nav-link">
                            <i class="bi bi-journal-medical"></i>
                            挂号记录管理
                        </a>
                    </div>
                    <div class="nav-item">
                        <a href="deptUpdate.jsp" class="nav-link active">
                            <i class="bi bi-building"></i>
                            科室管理
                        </a>
                    </div>
                </nav>
            </aside>

            <!-- 主要内容 -->
            <main class="main-content">
                <div class="content-header">
                    <h1>修改科室信息</h1>
                </div>
                <form action="./update" method="post" id="updateForm">
                    <div class="form-group">
                        <label class="form-label">科室编号</label>
                        <input type="text" class="form-control" name="deptId" id="deptId"
                               value="${sessionScope.user.deptId}" readonly>
                    </div>
                    <div class="form-group">
                        <label class="form-label">科室名称</label>
                        <input type="text" class="form-control" name="deptName" id="deptName"
                               placeholder="请输入新科室名称" required>
                    </div>
                    <div class="form-group">
                        <label class="form-label">科室说明</label>
                        <input type="text" class="form-control" name="deptRemark" id="deptRemark"
                               placeholder="请输入科室说明" required>
                    </div>
                    <div class="form-group">
                        <label class="form-label">科室类型</label>
                        <select class="form-select" name="deptType" required>
                            <option value="1">住院</option>
                            <option value="0">门诊</option>
                        </select>
                    </div>
                    <button type="submit" class="btn-submit">
                        提交修改
                    </button>
                </form>
            </main>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const form = document.getElementById('updateForm');
            const inputs = form.querySelectorAll('input');

            inputs.forEach(input => {
                input.addEventListener('focus', function() {
                    this.parentElement.classList.add('focused');
                });

                input.addEventListener('blur', function() {
                    if (!this.value) {
                        this.parentElement.classList.remove('focused');
                    }
                });
            });
        });
    </script>
</body>
</html>
